/**
 * @author maulin
 */
dojo.provide("medryx.widgets._TeamList.TeamListController");
dojo.require("medryx.context");

dojo.declare("medryx.widgets._TeamList.TeamListController", null, {
    view:null,
    constructor:function(view) {
        this.view = view;
        dojo.connect(view, "onTeamClicked", this, "pageTeam");
    },
	
	/**
	 * return a deferred that will callback for all teams
	 * that are to be display. the arguments are filter and sort
	 * either as parameters or as kw arguments
	 */
    loadTeams:function() {
        return medryx.context.entityManager.query("Team", arguments[0], "All");
    },
    
    pageTeam:function(team) {
        //var pageForm = new medryx.widgets.PageForm();
        //pageForm.setTeam(team);
        //pageForm.show();
        console.info("team clicked: (pageTeam not yet implemented)!", team);
    }
});